<template>
	<view class="card-container">
		<view class="" style="display: flex;gap: 10px;">
			<view class="">
				<image #header src="/static/logo.png" mode="widthFix" style="width: 100rpx;"></image>
			</view>
			<view class="">
				<text class="news-title">{{title}}</text>
			</view>

		</view>

		<view class="news-info">
			<view>

				<text v-if="isTop" class="top-tag">置顶</text>
				<text class="source">{{source}}</text>
				<text class="comments">{{comments}}</text>
			</view>
			<view>
				<text class="date">{{date}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "cardViewText",

		props: {
			title: {
				type: String,
				default: "新闻标题",
				required: true
			},
			isTop: {
				type: Boolean,
				default: true,
				required: true
			},
			source: {
				type: String,
				default: "来源",
				required: true
			},
			comments: {
				type: String,
				default: "333评",
				required: true
			},
			date: {
				type: String,
				default: "2025.10.15",
				required: true
			}
		}
	}
</script>

<style>
	.card-container {

		width: 88%;
		padding: 16rpx 16rpx 16rpx 20rpx;
		background-color: #ffffff;
		border-radius: 10px;
		box-sizing: border-box;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
		margin-bottom: 12px;
	}

	.news-title {
		font-size: 18px;
		font-weight: bold;
		color: #333333;
		display: block;
		margin-bottom: 12px;
	}

	.news-info {
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 14px;
		color: #999999;
	}

	.top-tag {
		color: #e53e3e;
		font-weight: 500;
		margin-right: 16px;
	}

	.source {
		margin-right: 16px;
	}

	.comments {
		margin-right: 16px;
	}

	.date {
		color: #bbbbbb;
	}
</style>